package cn.gson.crm.model.pojos;

import javax.persistence.*;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.Objects;

@Entity
@Table(name = "REPAIR_PAYMENT", schema = "CRM", catalog = "")
public class RepairPayment {
    private long reId;
    private Timestamp reTime;
    private Long reMoney;
    private RepairOrder repairOrder;
    private String reDesc;
    private Employee employee;
    private Customer customerByCustomerId;
    @ManyToOne//可选属性optional=false,表示author不能为空。删除文章，不影响用户
    @JoinColumn(name = "yg_id")//设置在article表中的关联字段(外键)
    public Employee getEmployee() {
        return employee;
    }

    public void setEmployee(Employee employee) {
        this.employee = employee;
    }
    @Id
    @Column(name = "RE_ID", nullable = false, precision = 0)
    @GeneratedValue(generator = "seq",strategy = GenerationType.SEQUENCE)
    //定义一个序列生成器
    @SequenceGenerator(name = "seq",sequenceName = "crm",
            initialValue = 1,allocationSize = 1)
    public long getReId() {
        return reId;
    }

    public void setReId(long reId) {
        this.reId = reId;
    }
    @Basic
    @Column(name = "RE_DESC", nullable = true)
    public String getReDesc() {
        return reDesc;
    }

    public void setReDesc(String reDesc) {
        this.reDesc = reDesc;
    }

    @Basic
    @Column(name = "RE_TIME", nullable = true)
    public Timestamp getReTime() {
        return reTime;
    }

    public void setReTime(Timestamp reTime) {
        this.reTime = reTime;
    }

    @Basic
    @Column(name = "RE_MONEY", nullable = true, precision = 0)
    public Long getReMoney() {
        return reMoney;
    }

    public void setReMoney(Long reMoney) {
        this.reMoney = reMoney;
    }
    @ManyToOne//可选属性optional=false,表示author不能为空。删除文章，不影响用户
    @JoinColumn(name = "REPAIR_ID")//设置在article表中的关联字段(外键)
    public RepairOrder getRepairOrder() {
        return repairOrder;
    }

    public void setRepairOrder(RepairOrder repairOrder) {
        this.repairOrder = repairOrder;
    }

    @ManyToOne
    @JoinColumn(name = "customer_id", referencedColumnName = "customer_id")
    public Customer getCustomerByCustomerId() {
        return customerByCustomerId;
    }

    public void setCustomerByCustomerId(Customer customerByCustomerId) {
        this.customerByCustomerId = customerByCustomerId;
    }

}
